package ua.org.extjsbuilder.projects;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import ua.org.extjsbuilder.wizards.CSSNewFileWizard;
import ua.org.extjsbuilder.wizards.ExtjsNewComponentWizard;
import ua.org.extjsbuilder.wizards.ExtjsNewProjectWizard;
import ua.org.extjsbuilder.wizards.HTMLNewFileWizard;
import ua.org.extjsbuilder.wizards.JSNewFileWizard;

public class ExtjsPerspectiveFactory implements IPerspectiveFactory {
	private static final String ID_PROJECT_EXPLORER = "ua.org.extjsbuilder.views.general";

	public void createInitialLayout(IPageLayout layout) {
		layout.addNewWizardShortcut(ExtjsNewComponentWizard.class.getName());
		layout.addNewWizardShortcut(ExtjsNewProjectWizard.class.getName());
		layout.addNewWizardShortcut(JSNewFileWizard.class.getName());
		layout.addNewWizardShortcut(HTMLNewFileWizard.class.getName());
		layout.addNewWizardShortcut(CSSNewFileWizard.class.getName());
		
		String editorArea = layout.getEditorArea();
		IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.25f, editorArea);
		topLeft.addView(ID_PROJECT_EXPLORER);
		topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS);
		
		IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.50f,"topLeft");
		bottomLeft.addView(IPageLayout.ID_OUTLINE);
		bottomLeft.addView(IPageLayout.ID_PROP_SHEET);
		
		layout.addView(IPageLayout.ID_TASK_LIST, IPageLayout.BOTTOM, 0.66f, editorArea);
	}
}
